package com.suixun.enums;

public enum ShowEnum {

	HIDE(0, "隐藏"), SHOW(1, "展示");

	private int type;

	private String value;

	private ShowEnum(int type, String value) {
		this.type = type;
		this.value = value;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	/**
	 * 是否包含value值
	 * 
	 * @param type
	 * @return
	 */
	public static boolean containType(int type) {
		ShowEnum[] values = ShowEnum.values();
		for (int i = 0; i < values.length; i++) {
			if (type == values[i].getType()) {
				return true;
			}
		}
		return false;
	}

	/**
	 * 功能描述: 获取对应的值
	 * @param type
	 * @return
	 */
	public static String getValue(int type) {
		for (ShowEnum c : ShowEnum.values()) {
			if (c.getType() == type) {
				return c.value;
			}
		}
		return null;
	}
}
